{% extends 'base.html' %}
{% block title %}
    增加机房
{% endblock %}

{% block breadcrumb %}
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-home"></i> Home</a></li>
        <li>机房管理</li>
        <li class="active">增加机房</li>
    </ol>
{% endblock %}
{% block status %}
    增加机房
{% endblock %}

{% block content %}
<div class="row">
    <div class="col-lg-12">
        <div class="box box-info">
            <!-- form start -->
            <form class="form-horizontal" action="/assets/idc/{{ idc_id }}/change/" method="post">
              <div class="box-body">
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">机房名称</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control"name="name" value="{{ idc_obj.name }}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">机房带宽</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="bandwidth" value="{{ idc_obj.bandwidth }}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">机房地址</label>
                  <div class="col-sm-3">
                      <input type="text" class="form-control" name="address" value="{{ idc_obj.address }}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">联系电话</label>

                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="phone" value="{{ idc_obj.phone }}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">ISP类型</label>

                  <div class="col-sm-3">
                    <select name="operator" style="height: 34px;width: 120px" id="operator">
                          <option value="">--------</option>
                          {% for isp in isp_list %}
                              <option value="{{ isp.id }}">{{ isp.name }}</option>
                          {% endfor %}
                      </select>
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">机房类型</label>

                  <div class="col-sm-3">
                    <select name="type" style="height: 34px;width: 120px" id="type">
                          <option value="">--------</option>
                          {% for type in type_list %}
                              <option value="{{ type.id }}">{{ type.name }}</option>
                          {% endfor %}
                      </select>
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">联系人</label>

                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="contact" value="{{ idc_obj.contacts }}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">备注</label>

                  <div class="col-sm-3">
                      <input type="text" class="form-control" name="memo" value="{{ idc_obj.memo }}">
                  </div>
                </div>
              </div>
              <!-- /.box-body -->
              <div class="box-footer" style="margin-right: 100px">
                <button type="submit" class="btn btn-info pull-right">保存</button>
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
    </div>
</div>
{% endblock %}

{% block action %}
    <script type="text/javascript">
        window.onload=function () {
            $("#operator").val({{ idc_obj.operator_id }}).attr("selected",true);
            $("#type").val({{ idc_obj.type_id }}).attr("selected",true);
        }
    </script>
{% endblock %}